<template>
  <a-layout style="height: 100%">
    <a-layout-header class="header">
      <a-row>
        <a-col :span="12" class="heard-left">
          <img :src="imgUrl" class="heard-logo" /><span class="heard-name"
            >Vue-mobile-hxq</span
          >
        </a-col>
        <a-col :span="12" class="heard-right">
          <a-menu
            v-model:selectedKeys="headerSelectedKey"
            mode="horizontal"
            theme="light"
            :style="{ lineHeight: '64px' }"
          >
            <a-menu-item v-for="(item, index) in heardMenu" :key="index">{{
              item
            }}</a-menu-item>
          </a-menu>
          <div>
            <img :src="getAssetsImages('logo-black.svg')" class="heard-logo" />
          </div>
        </a-col>
      </a-row>
    </a-layout-header>
    <a-layout class="con">
      <a-layout-sider width="200" style="background: #fff">
        <a-menu
          v-model:selectedKeys="selectedKeys2"
          v-model:openKeys="openKeys"
          mode="inline"
          :style="{ height: '100%', borderRight: 0 }"
        >
          <a-sub-menu key="sub1">
            <template #title>
              <span>
                <user-outlined />
                文档说明
              </span>
            </template>
            <a-menu-item key="1">option1</a-menu-item>
            <a-menu-item key="2">option2</a-menu-item>
            <a-menu-item key="3">option3</a-menu-item>
            <a-menu-item key="4">option4</a-menu-item>
          </a-sub-menu>
          <a-sub-menu key="sub2">
            <template #title>
              <span>
                <laptop-outlined />
                移动端文档
              </span>
            </template>
            <a-menu-item key="5">option5</a-menu-item>
            <a-menu-item key="6">option6</a-menu-item>
            <a-menu-item key="7">option7</a-menu-item>
            <a-menu-item key="8">option8</a-menu-item>
          </a-sub-menu>
          <a-sub-menu key="sub3">
            <template #title>
              <span>
                <notification-outlined />
                PC端文档
              </span>
            </template>
            <a-menu-item key="9">option9</a-menu-item>
            <a-menu-item key="10">option10</a-menu-item>
            <a-menu-item key="11">option11</a-menu-item>
            <a-menu-item key="12">option12</a-menu-item>
          </a-sub-menu>
        </a-menu>
      </a-layout-sider>
      <a-layout :style="{ padding: '20px', width: '100%' }">
        <a-breadcrumb style="margin: 16px 0">
          <a-breadcrumb-item>Home</a-breadcrumb-item>
          <a-breadcrumb-item>List</a-breadcrumb-item>
          <a-breadcrumb-item>App</a-breadcrumb-item>
        </a-breadcrumb>
        <a-layout-content
          :style="{
            margin: 0,
            height: 'calc(100% - 52px)',
          }"
        >
        <div @click="urlTo">跳转</div>
          <router-view class="routerDiv"></router-view>
        </a-layout-content>
      </a-layout>
    </a-layout>
  </a-layout>
</template>
<script lang="ts" setup>
import {
  UserOutlined,
  LaptopOutlined,
  NotificationOutlined,
} from "@ant-design/icons-vue";
import img from "assets/images/logo.png";
import { ref } from "vue";
import { getAssetsImages } from "utils/imgTools";
import {useRouter} from 'vue-router'
const router=useRouter();
function urlTo(){
    router.push('/mobile/form')
}
// import {useCounterStore} from 'stores/counter';
// import {userInfoStore} from 'stores/user/userInfo'
// const a=useCounterStore();
// const b=userInfoStore().userName;
// alert(a.count+userInfoStore().userName)
const imgUrl = ref(getAssetsImages("logo.png"));
//头部导航菜单及默认选中
const heardMenu = ref<string[]>(["文档说明", "移动端文档", "PC端文档"]);
const headerSelectedKey = ref<number[]>([1]);

const selectedKeys2 = ref<string[]>(["1"]);
const collapsed = ref<boolean>(false);
const openKeys = ref<string[]>(["sub1"]);
</script>

<style lang="scss" scoped>
.routerDiv {
  width: 100%;
  height: 100%;
}
.header {
  background-color: #fff;
  .heard-left {
    padding-left: 70px;
    .heard-logo {
      width: 35px;
    }
    .heard-name {
      color: #000000d9;
      font-size: 18px;
      font-weight: bold;
      margin-left: 20px;
    }
  }
  .heard-right {
    display: flex;
    padding-right: 70px;
    justify-content: right;

    .heard-logo {
      width: 65px;
      margin-left: 10px;
    }
  }
}
.con {
  display: flex;
  height: calc(100% - 71px);
  margin-top: 7px;
  background-color: #fff;
}
</style>
